﻿using Service;
using System;
using System.Threading.Tasks;

namespace Pub_Sub
{
    class Program
    {
        static void Main(string[] args)
        {

            var channel = "Wuhu";
            Console.WriteLine($"已订阅频道:{channel}");

            //PubService pubService = new PubService(channel);
            SubService subService = new SubService();
            Task.Run(() =>
            {
                subService.Subscrib(channel, (c, m) =>
                {
                    Console.WriteLine($"频道: {c} 发送消息:{m}");
                });
            });
            Console.ReadLine();
        }
    }
}
